<?
include("../com.inc.php");
$pow=$_REQUEST["pow"];
$id=$_REQUEST["id"];
if($id==$_SESSION['memberID'])exit("<script>alert('不可修改自己的权限!')</script>");
/* $maxpow=explode(",",$GLOBALS['le']->f("qx"));
if(count(array_diff($pow,$maxpow)))exit("<script>alert('开启的权限过大!')</script>"); */
$sel="select parent_id from pft_member_relationship where son_id_type=2 and ship_type=1 and son_id=".$id;
$GLOBALS['le']->query($sel);
$GLOBALS['le']->fetch_assoc();
if($GLOBALS['le']->f("parent_id")!=$_SESSION['sid'])exit("<script>alert('无权修改!')</script>");
$pow=count($pow)==0?"":implode(",",$pow);
if(p_match($pow))exit("<script>alert('权限内容存在非法!');</script>");
$upd="update pft_member set member_auth='".$pow."' where id=".$id." limit 1";
if($GLOBALS['le']->query($upd)){
	exit("<script>alert('权限修改成功!');</script>");//
}
?>